package Domain;

import Technical.Database;
import java.io.Serializable;

public class UserBean implements Serializable{

    private String userName, firstName, lastName, password;
    Database db = new Database();
	private int userId;

    public String getfirstName() {
        return firstName;
    }

    public String getlastName() {
        return lastName;
    }

    public String getuserName() {
        return userName;
    }
    
    public String getpassword(){
        return password;
    }
	
	public int getuserId(){
		return userId;
	}

    public void setfirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setlastName(String lastName) {
        this.lastName = lastName;
    }

    public void setuserName(String userName) {
        this.userName = userName;
    }
    public void setpassword(String password){
        this.password = password;
    }
    public Boolean validatePassword(){
        return db.validatePassword(userName,password);
    }
    public void copy(UserBean copy){
        this.userName = copy.getuserName();
        this.password = copy.getpassword();
        this.firstName = copy.getfirstName();
        this.lastName = copy.getlastName();
    }
	public void setuserId(int userId){
		this.userId = userId;
	}
    
    @Override
    public String toString(){
        return userName;
    }
}
